import copy


class CPU:
    pass


class Disk:
    pass


class Computer:
    def __init__(self, cpu, disk):
        self.cpu = cpu
        self.disk = disk


if __name__ == '__main__':
    cpu = CPU()
    disk = Disk()
    com = Computer(cpu, disk)
    print('cpu内存地址', cpu)
    print('disk内存地址', disk)
    print('com内存地址', com)
    print('com.cpu内存地址', com.cpu)
    print('com.disk内存地址', com.disk)
    # 地址拷贝
    com1 = com
    print('com1内存地址', com1)
    # copy 对象拷贝，类对象的浅拷贝
    com2 = copy.copy(com)
    print('com2内存地址', com2)
    print('com2.cpu内存地址', com2.cpu)
    print('com2.disk内存地址', com2.disk)
    # deepcopy 对戏那个拷贝，类对象的深拷贝
    com3 = copy.deepcopy(com)
    print('com3内存地址', com3)
    print('com3.cpu内存地址', com3.cpu)
    print('com3.disk内存地址', com3.disk)
